#include<bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int n,num;
int maxn;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n;
    for(int i = 1;i <= n;i ++){
        cin >> a[i];
        b[a[i]] ++;
        num ++;
        if(a[i] > maxn){
            maxn = a[i];
        }
    }
    if(maxn == 2){
        if(b[2] > b[1])
        {
            cout << n - b[1];
        }
        else{
            cout << n - b[2];
        }
        return 0;
    }
    sort(a + 1,a + n + 1);
    int x = 1;
    for(int i = x;i <= n;i ++)
    {
        for(int j = x + 1;j <= n;j ++)
            if(a[j] > a[i] && b[a[j]] != 0 && a[i] != 0){
                b[a[i]] --;
                a[i] = 0;
                b[a[j]] --;
                x ++;
                num --;
            }
    }
    cout <<num;
    return 0;
}
